<?php
	/**
	 * This is a quick-and-dirty draft QForm object to do the List All functionality
	 * of the ContactPhone class.  It uses the code-generated
	 * ContactPhoneDataGrid control which has meta-methods to help with
	 * easily creating/defining ContactPhone columns.
	 *
	 * Any display customizations and presentation-tier logic can be implemented
	 * here by overriding existing or implementing new methods, properties and variables.
	 * 
	 * NOTE: This file is overwritten on any code regenerations.  If you want to make
	 * permanent changes, it is STRONGLY RECOMMENDED to move both contact_phone_list.php AND
	 * contact_phone_list.tpl.php out of this Form Drafts directory.
	 *
	 * @package flx_qcubed
	 * @subpackage FormBaseObjects
	 */
	abstract class ContactPhoneListFormBase extends QForm {
		// Local instance of the Meta DataGrid to list ContactPhones
		/**
		 * @var ContactPhoneDataGrid dtgContactPhones
		 */
		protected $dtgContactPhones;

		// Create QForm Event Handlers as Needed

//		protected function Form_Exit() {}
//		protected function Form_Load() {}
//		protected function Form_PreRender() {}
//		protected function Form_Validate() {}

		protected function Form_Run() {
			parent::Form_Run();
		}

		protected function Form_Create() {
			parent::Form_Create();

			// Instantiate the Meta DataGrid
			$this->dtgContactPhones = new ContactPhoneDataGrid($this);

			// Style the DataGrid (if desired)
			$this->dtgContactPhones->CssClass = 'datagrid';
			$this->dtgContactPhones->AlternateRowStyle->CssClass = 'alternate';

			// Add Pagination (if desired)
			$this->dtgContactPhones->Paginator = new QPaginator($this->dtgContactPhones);
			$this->dtgContactPhones->ItemsPerPage = __FORM_DRAFTS_FORM_LIST_ITEMS_PER_PAGE__;

			// Use the MetaDataGrid functionality to add Columns for this datagrid

			// Create an Edit Column
			$strEditPageUrl = __VIRTUAL_DIRECTORY__ . __FORM_DRAFTS__ . '/contact_phone_edit.php';
			$this->dtgContactPhones->MetaAddEditLinkColumn($strEditPageUrl, 'Edit', 'Edit');

			// Create the Other Columns (note that you can use strings for contact_phone's properties, or you
			// can traverse down QQN::contact_phone() to display fields that are down the hierarchy)
			$this->dtgContactPhones->MetaAddColumn('Id');
			$this->dtgContactPhones->MetaAddColumn(QQN::ContactPhone()->Contact);
			$this->dtgContactPhones->MetaAddColumn('Number');
			$this->dtgContactPhones->MetaAddColumn('LogUser');
			$this->dtgContactPhones->MetaAddColumn('LogInsert');
			$this->dtgContactPhones->MetaAddColumn('LogUpdate');
		}
	}
?>
